package com.xh.demo.service;

import com.xh.demo.dao.mapper.UserMapper;
import com.xh.demo.domain.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Name UserServiceImpl
 * @Description
 * @Author wen
 * @Date 2019-07-31
 */
@Service
public class UserServiceImpl implements IUserService{

    @Autowired
    private UserMapper userMapper;

    @Override
    public int add(User user) {
        return userMapper.insert(user);
    }

    @Override
    public User getById(long id) {
        return userMapper.selectById(id);
    }

    @Override
    public List<User> getAll() {
        return userMapper.selectAll();
    }
}
